package com.yunfeng.supercall.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.View.OnClickListener;

import com.ly.quickdev.library.fragment.DevBaseFragment;
import com.yunfeng.supercall.R;
import com.yunfeng.supercall.activity.AddSuperFriendsActivity;
import com.yunfeng.supercall.activity.SearchUserActivity;
import com.yunfeng.supercall.bean.Constants;
import com.yunfeng.supercall.httputils.HttpClient;

public class BaseFragment extends DevBaseFragment implements Constants {

	protected HttpClient mHttpClient;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mHttpClient = new HttpClient();
	}

	public void showProgressDialog(int resId) {
		showProgressDialog(getString(resId));
	}

	@Override
	public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		View searc = findViewById(R.id.search_area);
		if (searc != null) {
			searc.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					startActivity(new Intent(getActivity(),
							SearchUserActivity.class));
				}
			});
		}
		View add = findViewById(R.id.add_friends_area);
		if (add != null) {
			add.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					startActivity(new Intent(getActivity(),
							AddSuperFriendsActivity.class));
				}
			});
		}
	}
}
